package com.usdt.system.dto.cp;

import java.util.ArrayList;
import java.util.List;

import org.springframework.util.CollectionUtils;

import com.usdt.system.domain.resp.ActivityCalendarV2Resp;
import com.usdt.system.domain.resp.ActivityCalendarV3Resp;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@Data
public class WeeklyScheduleDTO {
	
	private String date;
	
	private String month1;
	private String month2;
	private String month3;
	private String month4;
	private String month5;
	private String month6;
	private String month7;
	private String month8="本月寿星";
	
	//合并单元格开始行
	private int firstRow;
	
	private int lastRow;
	
	//private List<ActivityCalendarV3Resp> week1List;
	
	/*public List<ActivityCalendarV3Resp> getWeek1List(){
		return week1.getV3List();
	}*/
	
    // 上半部分: 周一 ~ 周四 (4天)
    private ActivityCalendarV2Resp week1;
    private ActivityCalendarV2Resp week2;
    private ActivityCalendarV2Resp week3;
    private ActivityCalendarV2Resp week4;

    // 下半部分: 周五 ~ 周日 (3天)
    private ActivityCalendarV2Resp week5;
    private ActivityCalendarV2Resp week6;
    private ActivityCalendarV2Resp week7;
    private ActivityCalendarV2Resp week8;

    //private String birthdayTitle = "本月寿星"; // 固定标题
    //private String birthdayContent; // 寿星内容
    
    public String getMonth1(){
    	return week1.getMonth();
    }
    public String getMonth2(){
    	return week2.getMonth();
    }
    public String getMonth3(){
    	return week3.getMonth();
    }
    public String getMonth4(){
    	return week4.getMonth();
    }
    public String getMonth5(){
    	return week5.getMonth();
    }
    public String getMonth6(){
    	return week6.getMonth();
    }
    public String getMonth7(){
    	return week7.getMonth();
    }
    
    public ActivityCalendarV2Resp getWeek8(){
    	ActivityCalendarV2Resp week= new ActivityCalendarV2Resp();
    	List<ActivityCalendarV3Resp> v3List = new ArrayList<ActivityCalendarV3Resp>();
    	week.setV3List(v3List);
    	if(null!=week7 && !CollectionUtils.isEmpty(week7.getV3List())) {
    		int size = week7.getV3List().size();
    		for (int i = 0; i < size; i++) {
    			ActivityCalendarV3Resp re= new ActivityCalendarV3Resp();
    			v3List.add(re);
			}
    	}
    	return week;
    }
    
	public int getFirstRow(){
		int i = 1;
		if(null!=week1 && !CollectionUtils.isEmpty(week1.getV3List())) {
			i = week1.getV3List().size();
		}
		return i+5;
	}
	public int getLastRow(){
		int i = getFirstRow()+1;
		if(null!=week5 && !CollectionUtils.isEmpty(week5.getV3List())) {
			i = getFirstRow() + week5.getV3List().size();
		}
		return i;
	}
}
